-
Notifications
You must be signed in to change notification settings - Fork 63
Adds proper documentation for rsa_encrypt and rsa_decrypt. #598
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Adds proper documentation for rsa_encrypt and rsa_decrypt. #598
Conversation
wiktor-k
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks 👌
addf239 to
1c30489
Compare
ionut-arm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks, couple of minor tweaks ⬇️
391eb90 to
44e9562
Compare
wiktor-k
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it looks good but I've left a couple of small nitpicks 😅
tss-esapi/src/lib.rs
Outdated
| //! # Code examples | ||
| //! The code examples are just small snippets of all the different steps that are necessary | ||
| //! in order to get the examples to actually work so it is recommended to check all the steps | ||
| //! in comments in the source code, or in the documented examples in our repo. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm... I don't really know what this comment is trying to say, that the code examples are just rudimentary? Or that the commented-out sections may also be important? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is trying to say that the code examples in documentation are usually only showing a small part of all the necessary steps needed in order to make things actually work.
And that thing shown is mostly focused around context method call or other points of interest,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is trying to say that the code examples in documentation are usually only showing a small part of all the necessary steps needed in order to make things actually work.
And that thing shown is mostly focused around context method call or other points of interest,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will try to rephrase it to make that point clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better?
44e9562 to
c0a158f
Compare
Signed-off-by: Jesper Brynolf <jesper.brynolf@gmail.com>
c0a158f to
feafd12
Compare
| /// * `cipher_text` - The cipher text to be decrypted. | ||
| /// * `in_scheme` - The padding scheme to use if scheme associated with | ||
| /// the `key_handle` is [RsaDecryptionScheme::Null]. | ||
| /// * `label` - A label whose association with the message is to be verified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the label have to match the label used during encrypt?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TCG TPM 2.0 Specification, Revision 01.59, Part 3 - Commands, Section 14.3 - TPM2_RSA_Decrypt
If a label is used in the padding process of the scheme during encryption, the label parameter is required
to be present in the decryption process and label is required to be the same in both cases. If label is not
the same, the decrypt operation is very likely to fail ((TPM_RC_VALUE). If label is present (label.size !=
0), it shall be a byte stream whose last byte is zero or the TPM will return TPM_RC_VALUE.
NOTE 1 The size of label includes the terminating null.
I also noticed another thing that the label is optional. So I will have to adress that as well.
No description provided.